<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>6.1. Configurability and Validation Profile</title>
		<link type="text/css" rel="stylesheet" href="PLUGINS_ROOT/org.polarsys.capella.doc/html/styles.css"/>
	</head>
	<body>
		<h1 id="Capella_Configurability_and_Validation_Profiles">Capella Configurability and Validation Profiles</h1>
		<h2 id="Principles">Principles</h2>
		<p>Capella Configurability feature allows to configure the application for a custom usage. Commands, validation rules and other Capella features can be customized using the standard Eclipse preferences mechanism.</p>
		<p>There are three possible solutions to set a custom configuration:</p>
		<ol>
			<li>Using 
				<b>Workspace preferences</b>
			</li>
			<li>Setting 
				<b>Capella Project specific preferences</b>
			</li>
			<li>Referencing a 
				<b>Capella Configuration Project</b>
			</li>
		</ol>
		<p>The second solution overrides the first one. The third solution overrides the second one.</p>
		<p>The basic idea is to disable/enable Eclipse preferences in the standard dedicated pages and then rely on export/import mechanisms to share them or configure a selected Capella Project.</p>
		<p>The following preferences are available:</p>
		<ul>
			<li>Capella preferences, in particular customization of 	contextual menu entries depending on his role (Expert or Standard)</li>
			<li>Viewpoint Preferences (among others for Refresh management policy 	and diagram settings)</li>
			<li>Model Validation, in particular to create multiple validation rules 	sets</li>
			<li>Commands enablement and user profile management. Please notice that 	Commands and User Profiles preferences are only workspace scope 	preferences and cannot be set on a specific project or referenced 	from a configuration project (cf. 6.4. Commands &amp; User Profiles)</li>
		</ul>
		<p>
			<img height="33" width="33" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_6d2e0df.jpg"/> Migration features from one version to another are not supported for preferences configuration files (workspace preferences, Capella project specific preferences or Capella configuration project). Between minor versions (no modification of interfaces) these files shall be compatible (except if a validation rule referenced in a validation profile for instance is updated after a problem correction for instance).
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h2 id="Workspace_Preferences">Workspace Preferences</h2>
		<h3 id="Setting_Workspace_Preferences">Setting Workspace Preferences</h3>
		<p>Workspace preferences are set using the standard Eclipse preferences page Editor available from menu 
			<i>window &gt; Preferences.</i>
		</p>
		<p>Capella projects use by default Workspace preferences.</p>
		<p>
			<br/>

			<br/>
		</p>
		<p>
			<img height="437" width="900" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_m3c126a56.png"/>
		</p>
		<p>
			<b>Fig.1:</b> Setting Workspace preferences
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h3 id="Importing.2FExporting_Workspace_Preferences_from_workbench">Importing/Exporting Workspace Preferences from workbench</h3>
		<p>
			<br/>

			<br/>
		</p>
		<h4 id="Exporting_Workspace_Preferences">Exporting Workspace Preferences</h4>
		<p>Workspace preferences can be exported using the Export wizard. Right click in the Project Explorer and choose 
			<i>Export</i>.
		</p>
		<p>
			<img height="540" width="900" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_658237e5.png"/>
		</p>
		<p>
			<b>Fig.</b> Lauching the export wizard
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<p>In the export page choose 
			<i>Preferences</i> and click 
			<i>Next.</i>
		</p>
		<p>
			<img height="550" width="700" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_m427c425e.png"/>
		</p>
		<p>
			<b>Fig.</b> Export Preferences Wizard
		</p>
		<p>Choose the preferences to export and click on Finish to save them to a file in a Capella configuration project or in the file system.</p>
		<h4 id="Exporting_Validation_Preferences">Exporting Validation Preferences</h4>
		<p>Validation preferences can be exported only if there are different from the default settings. If you change validation workspace preferences you can export them.</p>
		<p>
			<img height="531" width="627" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_3e4be95c.png"/>
		</p>
		<p>
			<b>Fig</b>. Setting validation preferences
		</p>
		<p>
			<img height="553" width="556" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_10d0b870.png"/>
		</p>
		<p>
			<b>Fig</b>. Exporting validation preferences
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h4 id="Importing_Workspace_Preferences">Importing Workspace Preferences</h4>
		<p>Preferences can be imported using the Import wizard. Right click in the Project Explorer and choose 
			<i>Import</i>.
		</p>
		<p>
			<img height="300" width="650" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_19779b8b.png"/>
		</p>
		<p>
			<b>Fig.</b> Launching the import wizard
		</p>
		<p>In the export page choose 
			<i>Preferences</i> and click 
			<i>Next</i>. In the next page you can choose which preferences you want to import.
		</p>
		<p>
			<img height="550" width="470" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_629e8a60.png"/>
		</p>
		<p>
			<b>Fig</b>. Choosing preferences to import into the workspace
		</p>
		<h4 id="Example_of_export.2Fimport_mechanism">Example of export/import mechanism</h4>
		<p>To show how the workspace preference export/import mechanism works let&rsquo;s consider the following scenario:</p>
		<ol>
			<li>User 1 exports a set of preferences to 
				<i>&ldquo;user1_preferences.epf&rdquo;</i>
			</li>
			<li>User 2 starts Capella on a clean workspace (i.e. having 	default preferences) and make some changes</li>
			<li>User 2 imports the 
				<i>&ldquo;user1_preferences.epf&rdquo;</i>
			</li>
		</ol>
		<p>
			<br/>

			<br/>
		</p>
		<p>The following table gives the set of preferences in each step.</p>
		<p>
			<img border="0" src="Images/ExportImportEPF.PNG"/>

			<br/>

			<br/>
		</p>
		<ol>
			<li>This is the default behavior of 	Eclipse: the exported file stores only the preferences that differs 	from default, unchanged preferences are not exported.</li>
		</ol>
		<p>
			<img height="227" width="532" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_m654d581e.png"/>
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<p>You can choose to import only MA preferences and not validation ones to let the latter unchanged. You can also use a validation profile to get exactly the validation preferences that was exported.</p>
		<p>
			<br/>

			<br/>
		</p>
		<h4 id="Initializing_Workspace_Preferences_with_launch_arguments_.28-EPF.29">Initializing Workspace Preferences with launch arguments (-EPF)</h4>
		<p>Workspaces can be initialized at Capella startup using the following command line argument:</p>
		<p>-EPF &lt;absolute/path/to/file.epf&gt;</p>
		<p>Capella will initialize the Workspace with the preferences stored in the provided file.</p>
		<h4 id="Example_of_initialization_with_-EPF">Example of initialization with -EPF</h4>
		<p>To show how the workspace initialization with &ndash;EPF argument works let&rsquo;s consider the following scenario:</p>
		<ol>
			<li>User 1 exports a set of preferences to 
				<i>&ldquo;user1_preferences.epf&rdquo;</i>
			</li>
			<li>User 2 starts Capella on a 
				<b>clean or dirty</b> workspace 	with &ndash;EPF 
				<i>&ldquo;user1_preferences.epf&rdquo;</i>
			</li>
		</ol>
		<p>
			<br/>

			<br/>
		</p>
		<p>The following table gives the preferences in each step</p>
		<p>
			<img border="0" src="Images/ExportImportEPF.PNG"/>  

			<br/>

			<br/>
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h2 id="Capella_Project_specific_preferences">Capella Project specific preferences</h2>
		<p>Capella Project specific preferences can be set on a Capella project to override Workspace preferences.</p>
		<p>Capella Project specific preferences are set by right clicking on the project in Project Explorer, and choosing 
			<i>properties</i> menu.
		</p>
		<table border="1">
			<tr>
				<td>
					<p>
						<img height="48" width="48" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_3c78e109.png"/>
					</p>
				</td>
				<td>
					<p>To see 				.settings folder containing these local preferences, filtered by 				default, go to Project Explorer and select 				&ldquo;Customize View&hellip;&rdquo; dialog, uncheck 				&ldquo;*.resources&rdquo; choice.</p>
				</td>
				<td>
					<p>
						<br/>
					</p>
				</td>
			</tr>
			<tr>
				<td>
					<p>
						<img height="48" width="48" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_3c78e109.png"/>
					</p>
				</td>
				<td>
					<p>Capella 				Project specific preferences will 				
						<b>override</b> 				Workspace preferences.
					</p>
				</td>
				<td>
					<p>
						<br/>
					</p>
				</td>
			</tr>
			<tr>
				<td>
					<p>
						<br/>
					</p>
				</td>
				<td>
					<p>
						<br/>
					</p>
				</td>
			</tr>
		</table>
		<p>
			<br/>

			<br/>
		</p>
		<p>
			<img height="438" width="800" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_m5ee4e886.png"/>
		</p>
		<p>
			<b>Fig.2:</b> Setting Capella Project specific preferences
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<table border="1">
			<tr>
				<td>
					<p>
						<img height="48" width="48" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_3c78e109.png"/>
					</p>
				</td>
				<td>
					<p>Note that the Transitions/Generation preference category has a workspace scope. Thus, it is not possible to configure this preference category for a specific project.</p>
				</td>
			</tr>
		</table>
		<p>
			<br/>

			<br/>
		</p>
		<table border="1">
			<tr>
				<td>
					<p>
						<img height="48" width="48" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_3c78e109.png"/>
					</p>
				</td>
				<td>
					<p>Creating project specific preferences overrides workspace 				preferences.</p>
					<p>To go 				back to Workspace preferences all you need is to delete the 				&ldquo;.settings&rdquo; folder from the project.</p>
				</td>
			</tr>
		</table>
		<p>
			<br/>

			<br/>
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h2 id="Capella_Configuration_Project">Capella Configuration Project</h2>
		<p>Capella Configuration Projects can be used to externalize preferences settings, thus enabling to reuse them on several projects. They can be referenced by any Capella projects to reuse the saved preferences saved in this configuration.</p>
		<h3 id="Creating_Capella_Configuration_Project">Creating Capella Configuration Project</h3>
		<p>Capella Configuration Projects can be created by right clicking in the Capella project explorer and choosing &quot;Capella Configuration Project&quot; menu.</p>
		<p>
			<img height="400" width="900" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_271afec5.png"/>
		</p>
		<p>
			<b>Fig.</b>: Capella Configuration Project creation wizard
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h3 id="Referencing_Capella_Configuration_Project">Referencing Capella Configuration Project</h3>
		<p>Capella Configuration Project is used to store a specific configuration of preferences. Capella projects can reuse the preferences set on the Capella Configuration Project by referencing it.</p>
		<p>Referencing a Capella Configuration Project is done by right clicking on a Capella project, choosing 
			<i>properties</i> and selecting projects to reference in 
			<i>Capella Project References</i> option.
		</p>
		<p>
			<img height="450" width="900" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_73841760.png"/>
		</p>
		<p>
			<b>Fig.</b>: Referencing Capella Configuration project
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<table border="1">
			<tr>
				<td>
					<p>
						<img height="48" width="48" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_3c78e109.png"/>
					</p>
				</td>
				<td>
					<p>Referencing 				a Capella Configuration Project from a Capella project will 				
						<b>override</b> 				Capella Project specific preferences and Workspace preferences for 				this project.
					</p>
				</td>
			</tr>
		</table>
		<p>
			<br/>

			<br/>
		</p>
		<h2 id="Validation_Profiles">Validation Profiles</h2>
		<p>Validation profile is a mean to specify validation rule sets, thus enabling configuration reuse during validation of Capella model elements.</p>
		<h3 id="Creating_Validation_Profiles">Creating Validation Profiles</h3>
		<p>Validation profiles are created via Capella Export Preferences wizard and stored in standard Eclipse preferences files (with &ldquo;.epf&rdquo; file extension). Validation rule sets can be configured via 
			<i>Window &gt; Preferences</i> menu and exported with the Export Preferences wizard.
		</p>
		<p>Exported preferences (Validation profiles) can be stored into a Capella Configuration Project or to another path into the file system. Storing exported preferences to Capella Configuration Project enables reusing them for Capella model validation.</p>
		<p>
			<br/>

			<br/>

			<br/>

			<br/>

			<img height="450" width="662" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_m5d2e3203.png"/>
		</p>
		<p>
			<b>Fig.</b>: storing exported validation preferences to a Capella Configuration Project
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<p>
			<br/>

			<br/>
		</p>
		<h3 id="Using_Validation_Profiles">Using Validation Profiles</h3>
		<p>Validation profiles (preferences files stored into Capella Configuration Project) can be used during validation of Capella model elements. To enable this usage on a Capella project, a Capella Configuration Project containing at least one preferences file has to be referenced. All referenced validation profiles are then available during validation.</p>
		<p>
			<img height="612" width="643" border="0" src="Images/6.1.%20Configurability%20and%20Validation%20Profile_html_352efd77.png"/>
		</p>
		<p>
			<b>Fig.</b>: Using Validation profiles preferences for validation
		</p>
		<p>
			<br/>

			<br/>
		</p>
	</body>
</html>